﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjetoComperio.Framework.Web.Logging
{
    public static class ExceptionExtensions
    {
        public static String GetFullDescription(this Exception exception)
        {
            StringBuilder errorDescription = new StringBuilder();
            errorDescription.AppendLine("Message:" + exception.Message);
            errorDescription.AppendLine("Source:" + exception.Source);
            errorDescription.AppendLine("StackTrace:" + exception.StackTrace);
            if (exception.InnerException != null)
            {
                errorDescription.AppendLine("InnerException-Message:" + exception.InnerException.Message);
                errorDescription.AppendLine("StackTrace-:" + exception.InnerException.StackTrace);
            }
            return errorDescription.ToString();


        }
    }
}
